﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mitasoft.Books.Core
{
    public static class Extensions
    {
        /// <summary>
        /// Returns the name of a file
        /// </summary>
        /// <param name="uri"></param>
        /// <returns></returns>
        public static string GetFilename(this Uri uri)
        {
            string[] segments = uri.LocalPath.Split(new string[] { "\\" }, StringSplitOptions.None);
            return segments.ElementAt(segments.Length - 1);
        }
    }
}
